package com.soda.service.impl;

import java.util.List;

import com.soda.bean.News;
import com.soda.dao.NewsDao;
import com.soda.dao.impl.NewsDaoImpl;
import com.soda.service.NewsService;
import com.soda.util.PageInfo;
import com.soda.util.SelectNewsInfo;


public class NewsServiceImpl implements NewsService {
	NewsDao nd = new NewsDaoImpl();

	public List<News> showNews(int id) {

		return nd.showNews(id);
	}

	// 分页加条件查询

	public List<News> getAllNews(SelectNewsInfo sni, PageInfo pi) {

		return nd.getAllNews(sni, pi);
	}

	// 查询信息有几条
	public int getNewsCount(SelectNewsInfo sni) {
		// TODO Auto-generated method stub
		return nd.getNewsCount(sni);
	}

	// 删除
	public int deleteById(int id) {
		// TODO Auto-generated method stub
		return nd.deleteById(id);
	}

	// 根据ID查信息
	public News showAllNews(int id) {
		// TODO Auto-generated method stub
		return nd.showAllNews(id);
	}

	// 修改

	public int updateNews(int id, int recommend, String neirong) {

		return nd.updateNews(id, recommend, neirong);
	}

	// 增加
	public int addNews(News n) {
		return nd.addNews(n);
	}

	// 批量删除
	public int delAllNews(String []list) {

		return nd.delAllNews(list);
	}
 
public List<News> exportNews(String[] count) {
	// TODO Auto-generated method stub
	return nd.exportNews(count) ;
}

//修改状态
public int updateStateNews(int newId, int state) {
	 
	return nd.updateStateNews( newId, state);
}
	


}
